<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Psa_Result</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name"><img src="../media/images/Class_logo.png"
														alt=" Class"
														title=" Class"
														style="vertical-align: middle"> Psa_Result</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Class for object that is used for storing results from model methods.</p>
<p class="description"><p>Object instanced from this class should be used to collect results from models.  Its only purpose is to transfer results from model to view.  This class implements singleton pattern and beside that is without any properties or methods.  In <em>model</em> and <em>view</em> plugins you can access <kbd>Psa_Result</kbd> object through  references in local scope.  For example, you can add property to <kbd>Psa_Result</kbd> object in your model plugin  by <div class="src-code"><ol><li><div class="src-line"><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">psa_result</span><span class="src-sym">-&gt;</span><span class="src-id">my_value&nbsp;</span>=&nbsp;<span class="src-str">'123'</span><span class="src-sym">;</span></div></li>
</ol></div></p><p>Or you can get reference to <kbd>Psa_Result</kbd> object from any scope with:  <div class="src-code"><ol><li><div class="src-line"><span class="src-id"><a href="../psa/Psa_Result.html">Psa_Result</a></span><span class="src-sym">::</span><a href="../psa/Psa_Result.html#methodget_instance">get_instance</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
</ol></div></p><p>It implements <a href="http://en.wikipedia.org/wiki/Singleton_pattern">singleton pattern</a>  so you can get reference to result object from any scope with  <a href="../psa/Psa_Result.html#methodget_instance">get_instance()</a> method. You cannot make instance of Psa_Result object with  <var>new</var> operator.</p><p><strong>Example:</strong></p><p><div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-key">class&nbsp;</span><span class="src-id">example_model&nbsp;</span><span class="src-key">extends&nbsp;</span><a href="../psa/plugins/Psa_Plugin_Model.html">Psa_Plugin_Model</a>&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><span class="src-id">get_numbers</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;put&nbsp;some&nbsp;numbers&nbsp;in&nbsp;result&nbsp;object&nbsp;using&nbsp;reference&nbsp;in&nbsp;local&nbsp;scope</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">psa_result</span><span class="src-sym">-&gt;</span><span class="src-id">numbers&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,</span><span class="src-num">2</span><span class="src-sym">,</span><span class="src-num">3</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;or&nbsp;the&nbsp;same&nbsp;thing&nbsp;but&nbsp;using&nbsp;get_instance()&nbsp;method.&nbsp;This&nbsp;works&nbsp;from&nbsp;any&nbsp;scope.</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id"><a href="../psa/Psa_Result.html">Psa_Result</a></span><span class="src-sym">::</span><a href="../psa/Psa_Result.html#methodget_instance">get_instance</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">more_numbers&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-num">4</span><span class="src-sym">,</span><span class="src-num">5</span><span class="src-sym">,</span><span class="src-num">6</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line">&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-php">?&gt;</span></div></li>
</ol></div></p></p>
		<p class="notes">
			Located in <a class="field" href="_scripts---Psa_Result.class.php.html">/scripts/Psa_Result.class.php</a> (line <span class="field"><a href="../__filesource/fsource_psa__scriptsPsa_Result.class.php.html#a66">66</a></span>)
		</p>
		
				
		<pre>Psa_Singleton
   |
   --Psa_Result</pre>
	
			</div>
</div>




	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
												<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
												<div class="method-definition">
					<img src="../media/images/StaticMethod.png" alt=" "/>
											static <span class="method-result">void</span>
										<a href="#get_instance" title="details" class="method-name">get_instance</a>
										()
									</div>
																							</div>
		</div>
	</div>		

	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
													<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="methodget_instance" id="get_instance"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/StaticMethod.png" />
		<span class="method-title">static get_instance</span> (line <span class="line-number"><a href="../__filesource/fsource_psa__scriptsPsa_Result.class.php.html#a81">81</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns object's instance.</p>
<p class="description"><p>You should statically call this method with scope resolution operator (::) which gives you  instance to the object from any scope in your application.  Example:  <div class="src-code"><ol><li><div class="src-line">&nbsp;<span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-var">$result_object&nbsp;</span>=&nbsp;<span class="src-id"><a href="../psa/Psa_Result.html">Psa_Result</a></span><span class="src-sym">::</span><a href="../psa/Psa_Result.html#methodget_instance">get_instance</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line">&nbsp;<span class="src-php">?&gt;</span></div></li>
</ol></div></p></p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			get_instance
		</span>
				()
			</div>
	
		
			
	</div>
						
		</div>
	</div>

	
	<p class="notes" id="credit">
		Documentation generated on Thu, 21 Oct 2010 01:40:54 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.3</a>
	</p>
	</div></body>
</html>